package cn.kgc.kgde.bookstore.controller;

import cn.kgc.kgde.bookstore.entity.OrderDetail;
import cn.kgc.kgde.bookstore.entity.ResultInfo;
import cn.kgc.kgde.bookstore.mapper.OrderDetailMapper;
import cn.kgc.kgde.bookstore.service.OrderDetailService;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author myt
 * @since 2022-05-23
 */
@RestController
@RequestMapping("/orderDetail")
public class OrderDetailController {
    @Resource
    private OrderDetailService orderDetailService;

    //根据订单 -- 查看订单详情
    @GetMapping("/showOrderDetail")
    public ResultInfo showOrderDetail( String orderId){
        System.out.println("orderId = " + orderId);
        List<OrderDetail> orderDetailList = this.orderDetailService.findOrderList( orderId );
        System.out.println("orderDetailList = " + orderDetailList);
        return new ResultInfo( 200,"查询订单详情成功！",orderDetailList);
    }

}
